// var o;
// exports.OnlineGiftData = void 0;
// var $storageClass = require("../../resources/scripts/AL_Framework_Storage_Class");
// var AL_GAME_HUA_Define = require("./AL_GAME_HUA_Define");
// var s = {
//     recieveCount: 0,
//     timeRecord: 0,
//     giftUnlocked: !1,
//     dailyReward: !1,
//     dailyRewardPop: !0
// };
// var c = (function (e) {
//     function t() {
//         return (null !== e && e.apply(this, arguments)) || this;
//     }
//     __extends(t, e);
//     t.getInstance = function () {
//         return AL_APP_SDK_MANAGER.localManager.huoqu_cunchu_lei(t);
//     };
//     t.prototype.zhixing_chushihua_chuli = function () {
//         this.chushihua_cunchu_shuju(s);
//         this.chushihua_yuancheng_key(["recieveCount", "giftUnlocked", "dailyReward"]);
//     };
//     t.prototype.shuaxin_riqi_xianguan_shuju = function () {
//         this.recieveCount = 0;
//         this.timeRecord = 0;
//         this.dailyReward = !1;
//         this.dailyRewardPop = !0;
//         this.giftUnlocked = !1;
//     };
//     t.prototype.huoqu_liwu_shifou_jiesuo = function () {
//         return this.giftUnlocked;
//     };
//     t.prototype.shezhi_liwu_shifou_jiesuo = function (e) {
//         this.giftUnlocked = e;
//         AL_APP_SDK_MANAGER.emit(AL_GAME_HUA_Define.GameEvent.ONLINE_GIFT_UNLOCK, e);
//     };
//     t.prototype.tianjia_jieshou_cishu = function () {
//         this.recieveCount++;
//         this.timeRecord = 0;
//         this.shezhi_liwu_shifou_jiesuo(!1);
//     };
//     t.prototype.huoqu_jieshou_cishu = function () {
//         return this.recieveCount;
//     };
//     t.prototype.shezhi_shijian_jilu = function (e) {
//         this.timeRecord = e;
//     };
//     t.prototype.huoqu_shijian_jilu = function () {
//         return this.timeRecord;
//     };
//     t.bundle = AL_GAME_HUA_Define.Define.GAME_NAME;
//     t.key = "_f";
//     return t;
// })($storageClass.AL_Framework_Storage_Class);
// exports.OnlineGiftData = c;

const $storageClass = require("../../resources/scripts/AL_Framework_Storage_Class");
const AL_GAME_HUA_Define = require("./AL_GAME_HUA_Define");
/** 
 * OnlineGiftData 类用于存储和管理在线礼物数据，继承自 AL_Framework_Storage_Class。
 */
let localGiftData = {
    recieveCount: 0, // 接收次数
    timeRecord: 0,   // 时间记录
    giftUnlocked: false,    // 礼物解锁状态
    dailyReward: false,     // 每日奖励状态
    dailyRewardPop: true    // 每日奖励提示状态
};

class OnlineGiftData extends $storageClass.AL_Framework_Storage_Class {
    static bundle = AL_GAME_HUA_Define.Define.GAME_NAME; // 游戏名称
    static key = "_f"; // 键值

    /**
     * 获取 OnlineGiftData 实例
     * @returns {OnlineGiftData} 返回存储类的实例
     */
    static getInstance() {
        return AL_APP_SDK_MANAGER.localManager.huoqu_cunchu_lei(OnlineGiftData);
    }

    /** 
     * 初始化方法，初始化存储数据和远程键
     */
    zhixing_chushihua_chuli() {
        this.chushihua_cunchu_shuju(localGiftData);
        this.chushihua_yuancheng_key(["recieveCount", "giftUnlocked", "dailyReward"]);
    }

    /** 
     * 刷新日期，重置在线礼物相关参数
     */
    shuaxin_riqi_xianguan_shuju() {
        this.recieveCount = 0;
        this.timeRecord = 0;
        this.dailyReward = false;
        this.dailyRewardPop = true;
        this.giftUnlocked = false;
    }

    /**
     * 获取礼物解锁状态
     * @returns {boolean} 返回礼物解锁状态
     */
    huoqu_liwu_shifou_jiesuo() {
        return this.giftUnlocked;
    }

    /**
     * 设置礼物解锁状态
     * @param {boolean} unlocked 设置解锁状态
     */
    shezhi_liwu_shifou_jiesuo(unlocked) {
        this.giftUnlocked = unlocked;
        AL_APP_SDK_MANAGER.emit(AL_GAME_HUA_Define.GameEvent.ONLINE_GIFT_UNLOCK, unlocked);
    }

    /**
     * 增加接收次数，重置时间记录，并锁定礼物
     */
    tianjia_jieshou_cishu() {
        this.recieveCount++;
        this.timeRecord = 0;
        this.shezhi_liwu_shifou_jiesuo(false);
    }

    /**
     * 获取接收次数
     * @returns {number} 返回接收次数
     */
    huoqu_jieshou_cishu() {
        return this.recieveCount;
    }

    /**
     * 设置时间记录
     * @param {number} time 设置的时间记录
     */
    shezhi_shijian_jilu(time) {
        this.timeRecord = time;
    }

    /**
     * 获取时间记录
     * @returns {number} 返回时间记录
     */
    huoqu_shijian_jilu() {
        return this.timeRecord;
    }
}

exports.OnlineGiftData = OnlineGiftData;